#include <iostream>
#include <string>
#include <vector>
using namespace std;

vector<int> getDigits(string target) {
    vector<int> result;
    for (int i = 0; i < target.size(); i++) {
        char curr = target[i];
        if ((int)curr >= 65) { result.push_back((int)curr - 55); }
        else { result.push_back((int)curr - 48); }
    }
    return result;
}

char getDigitChar(int num) {
    if (num >= 0 && num <= 9) { return (char)(num + 48); }
    else { return (char)(num + 55); }
}

int main() {
    string target1, target2;
    cin >> target1 >> target2;
    vector<int> digits1 = getDigits(target1);
    vector<int> digits2 = getDigits(target2);
    string result = "";
    int carry = 0;
    int highDigitsCnt = digits1.size() > digits2.size() ?
    digits1.size() : digits2.size();
    for (int i = 0; i < highDigitsCnt; i++) {
        int curr = (digits1.size() - i - 1 >= 0 ? digits1[digits1.size() - i - 1] : 0) +
        (digits2.size() - i - 1 >= 0 ? digits2[digits2.size() - i - 1] : 0) + carry;
        carry = curr >= 36 ? 1 : 0;
        result = getDigitChar(curr % 36) + result;
    }
    if (carry == 1) { result = "1" + result; }
    cout << result;
    return 0;
}